﻿<div id="content_left">
	<div id="khoangcachtrai"></div>			
	<div id="duongdan"> 
		<a class="ac"><?php echo $catalog['Catalog']['tendanhmuc']; ?></a>	
	</div> <!--end duongdan--------------->
	<div id="khoangcachtrai"></div>	
	<!----danh sach cac danh muc con------------------>
				<div id="section_filter">
					<?php
						if($datatype==NULL){
							echo "<h2>Data Empty</h2>";
						}
						else{
							echo "<ul id=\"double\">";
							//echo "<li><a class=\"inactive\" href=\"/raovat_ttcn\">Tất cả</a>";
							echo "<li><a class=\"inactive\">";
							echo $this->Html->link("Tất cả", array('controller' => 'catalogs', 'action' => 'view', $catalog['Catalog']['id']));
							echo "</a></li>";
							foreach($datatype as $item){
							echo "<li><a class=\"inactive\">";
							
							echo $this->Html->link($item['Type']['tenloai'], array('controller' => 'catalogs', 'action' => 'view', $catalog['Catalog']['id'], $item['Type']['id']));
							echo "</a></li>";
							}
						}
					?>
				</div>
				<div id="khoangcachtrai"></div>
	<table width="100%" cellspacing="0" cellpadding="0" border="0">
			<tr>
			<td class="navtinvip" height="30">
			<div align="center">
			<span class="style2">TIN ĐĂNG VIP </span>
			</div>
			</td>
			</tr>
	</table>
	<table>
	<?php
	$i = 0;
	foreach ($data as $post):
		$class = null;
		if ($i++ % 2 == 0) {
			$class = ' class="altrow"';
		}
	?>
	<tr height="25" bgcolor="">
				<td class="inforvbar" align="center" width="16">
				<div class="imgborder">
				<img width="20" border="0" src="/raovat_ttcn/webroot/img/nopic.gif">
				</div>
				</a>
				</td>
				<td class="inforvbarvip" width="">
				<span>
				<a id="rvtitle" style="font-weight:bold;color:#FC2008;text-decoration:none;" onmouseout="hidetip();" href="/raovat_ttcn/posts/view/<?php echo $post['Post']['id'] ?>"><?php echo $post['Post']['tieude']; ?></a>
				<font color="green"></font>
				</span>
				<span style="margin-left: 2px;">
				<img align="abstop" border="0" src="/raovat_ttcn/webroot/img/icon_vip.gif">
				</span>
				</td>
				<td class="inforvbar decsmall" align="center" width="15%"><?php echo $post['Type']['tenloai']; ?></td>
				<td class="inforvbar decsmall" align="center" width="20%"><?php echo $post['Post']['created']; ?></td>
				<td class="inforvbar decsmall" align="right" width="14%"><?php echo $post['Post']['tinhthanh']; ?></td>
				</tr>
<?php endforeach; ?>
	</table>
	<!---------------------------------Tin moi dang --------------------------------------------------->
				<table width="100%" cellspacing="0" cellpadding="0" border="0">
				<tr>
				<td class="navtinmoi" width="100%" height="30">
				<div align="center">
				<span class="style2">
				<strong>TIN MỚI ĐĂNG </strong>
				</span>
				</div>
				</td>
				</tr>
				</table>	
				<!-----------------------------------danh sach tin moi------------------------------------------------->
				<table>	
					<?php
						$i = 0;
						foreach ($data2 as $post2):
						$class = null;
						if ($i++ % 2 == 0) {
						$class = ' class="altrow"';
						}
					?>
					<tr height="25" bgcolor="#FCFCFE">
						<td class="inforvbar" align="center" width="16">
						<div class="imgborder">
						<img width="20" border="0" src="/raovat_ttcn/webroot/img/nopic.gif">
						<div id="imageraovat"></div>
						<img width="20" border="0" src="/raovat_ttcn/webroot/img/nopic.gif">
						</div>
						</a>
						</td>
						<td class="inforvbar">
						<span>
						<a id="rvtitle" onmouseout="hidetip();" href="/raovat_ttcn/posts/view/<?php echo $post2['Post']['id'] ?>"><?php echo $post2['Post']['tieude']; ?></a>
						<font color="green"></font>
						</span>
						</td>
						<td class="inforvbar decsmall" align="center" width="15%"><?php echo $post2['Type']['tenloai']; ?></td>
						<td class="inforvbar decsmall" align="center" width="20%"><?php echo $post2['Post']['created']; ?></td>
						<td class="inforvbar decsmall" align="right" width="14%"><?php echo $post2['Post']['tinhthanh']; ?></td>
					</tr>
					<?php endforeach; ?>
				</table>
				
				
       
	<!------------------------------------------phan trang ------------------------------------------------------>
				<div class="pagelinkbox">
				<ul class="nav">
					 <?php 
					if($page > 1) { //neu can hien thi so trang
					   
						$current = $p;
						
						//Hien thi trang Previous
						if($current !=1) {
						echo "<li><a href='/raovat_ttcn/catalogs/view/".$id."?p=".($p-1)."'>Previous</a></li>";
						}
						//Hien thi so link
						for($i=1;$i<=$page;$i++) {
							if($current != $i) {
							echo "<li><a href='/raovat_ttcn/catalogs/view/".$id."?p=".$i."'>$i</a></li>";
						} else {
							echo "<li class='current'>$i</li>";
						}
						} //End: FOR
						
						//Hien thi trang Next
						
						if($current != $page) {
							echo "<li><a href='/raovat_ttcn/catalogs/view/".$id."?p=".($p+1)."'>Next</a></li>";
						}
						
					}//End: $page > 1 IF
        ?>
			</ul>
				</div>
</div>

</div> <!-- end content_left -->